$(function(){

	//登录框的效果

		$('#logout_user_info .login,.login').click(function(){
			$('#screen').show();
		});

		$('.qx').click(function(){
			$('#screen').hide();
		});
		$('.username').focusin(function(){
			$(this).css({"border-color":"#488EE7"})
			$('.user-img').css({"background-position":"0 -108px"})
		});

		$('.username').focusout(function(){
			$(this).css({"border-color":"#ddd"})
			$('.user-img').css({"background-position":"0 -68px"})
		});

		$('.password').focusin(function(){
			$(this).css({"border-color":"#488EE7"})
			$('.password-img').css({"background-position":"0 -186px"})
		});

		$('.password').focusout(function(){
			$(this).css({"border-color":"#ddd"})
			$('.password-img').css({"background-position":"0 -147px"})
		});
});

	$(function () {
		$(".code").validate({
		// 验证规则
		 code: {
			 rule: {
			 required: true,
			 ajax: CONTROLLER+"/ajax_code"
			 },
		 error: {
			 required: " 验证码不能为空",
			 ajax: " 验证码输入错误"
		 },
		 message: " 请输入验证码",
		 success: " 输入正确"
		 }
		 });

		$(".username").validate({
		// 验证规则
		 username: {
			 rule: {
			 required: true,
			 ajax: CONTROLLER+"/ajax_user"
			 },
		 error: {
			 required: "用户名不能为空",
			 ajax: " 用户名不存在"
		 },
		 message: " 请输入用户名",
		 success: " 输入正确"
		 }
		 });


		$('.import_city').focusin(function(){
			$('.switch-action').hide();
			$('#muti-aois .aois').show();
			$(this).parent('.select_city').find('i').hide();
			$(this).parent('.select_city').find('.city-locate').show();
		});
		$('.import_city').focusout(function(){
			$('.switch-action').show();
			$('#muti-aois .aois').hide();
			$(this).parent('.select_city').find('i').show();
			
		});

		$('.city-locate').click(function(){
			
			$('#muti-aois .cities').show();
		})
 })